package imnu.th.tongbu02;

/**
 * @author: lys
 * @类名: Clinet
 * @Title:
 * @date: 2020/7/22
 **/
public class Client extends Thread {
    private Bank bank;
    private int want;

    public Client(){}
    public Client(String name, Bank bank, int want){
        super(name);
        this.bank = bank;
        this.want = want;
    }

    @Override
    public void run() {
        int money;
        while (true){
            if ((money = this.bank.getMonet(want)) <= 0){
                break;
            }
        }
        System.out.println("取款结束。。。");
        System.out.println();
    }


    public int getWant() {
        return want;
    }

    public void setWant(int want) {
        this.want = want;
    }

    public Bank getBank() {
        return bank;
    }

    public void setBank(Bank bank) {
        this.bank = bank;
    }
}
